<html>
<script>
  function enterHandler (ev) {
    console.log("enter", ev)
  }
  function leaveHandler (ev) {
    console.log("leave", ev)
  }
  function moveHandler (ev) {
    console.log("move", ev)
  }
  function init () {
    var el = document.getElementById("target1");
    el.onpointerenter = enterHandler;
    el.onpointerleave = leaveHandler;
    el.onpointermove = moveHandler;
  }
</script>

<body onload="init();">
  <div id="target1" style="width: 300px;height: 300px;background-color: gray;"> 点我 ... </div>
  <div id="target2" onpointerenter="enterHandler(event)"> 点我 ... </div>
</body>

</html>